import axios from 'axios';

const api = axios.create({
  baseURL: import.meta.env.VITE_API_BASE_URL + '/test3',
  headers: {
    'Content-Type': 'application/json'
  }
});

export const getMerchants = (schoolId) => {
  return api.post('/cptThirdPartMerchant/get', { schoolId })
    .then(response => {
      if (response.data.status === 200) {
        return response.data.message;
      }
      throw new Error('请求失败');
    })
    .catch(error => {
      console.error('API请求错误:', error);
      throw error;
    });
};